using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.S_AdTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HL_Advertisement1TableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HL_Advertisement1TableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HL_Advertisement1";
			dataTableMapping.ColumnMappings.Add("ADID", "ADID");
			dataTableMapping.ColumnMappings.Add("UserID", "UserID");
			dataTableMapping.ColumnMappings.Add("ZoneID", "ZoneID");
			dataTableMapping.ColumnMappings.Add("ADType", "ADType");
			dataTableMapping.ColumnMappings.Add("ADName", "ADName");
			dataTableMapping.ColumnMappings.Add("ImgUrl", "ImgUrl");
			dataTableMapping.ColumnMappings.Add("ImgWidth", "ImgWidth");
			dataTableMapping.ColumnMappings.Add("ImgHeight", "ImgHeight");
			dataTableMapping.ColumnMappings.Add("FlashWmode", "FlashWmode");
			dataTableMapping.ColumnMappings.Add("ADIntro", "ADIntro");
			dataTableMapping.ColumnMappings.Add("LinkUrl", "LinkUrl");
			dataTableMapping.ColumnMappings.Add("LinkTarget", "LinkTarget");
			dataTableMapping.ColumnMappings.Add("LinkAlt", "LinkAlt");
			dataTableMapping.ColumnMappings.Add("Priority", "Priority");
			dataTableMapping.ColumnMappings.Add("Setting", "Setting");
			dataTableMapping.ColumnMappings.Add("CountView", "CountView");
			dataTableMapping.ColumnMappings.Add("Views", "Views");
			dataTableMapping.ColumnMappings.Add("CountClick", "CountClick");
			dataTableMapping.ColumnMappings.Add("Clicks", "Clicks");
			dataTableMapping.ColumnMappings.Add("Passed", "Passed");
			dataTableMapping.ColumnMappings.Add("EndTime", "EndTime");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HL_Advertisement] WHERE (([ADID] = @Original_ADID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_ADID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HL_Advertisement] ([UserID], [ZoneID], [ADType], [ADName], [ImgUrl], [ImgWidth], [ImgHeight], [FlashWmode], [ADIntro], [LinkUrl], [LinkTarget], [LinkAlt], [Priority], [Setting], [CountView], [Views], [CountClick], [Clicks], [Passed], [EndTime]) VALUES (@UserID, @ZoneID, @ADType, @ADName, @ImgUrl, @ImgWidth, @ImgHeight, @FlashWmode, @ADIntro, @LinkUrl, @LinkTarget, @LinkAlt, @Priority, @Setting, @CountView, @Views, @CountClick, @Clicks, @Passed, @EndTime)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ZoneID", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ZoneID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ADType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ADType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ADName", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "ADName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ImgUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "ImgUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ImgWidth", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ImgWidth", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ImgHeight", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ImgHeight", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@FlashWmode", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "FlashWmode", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ADIntro", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ADIntro", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@LinkUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "LinkUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@LinkTarget", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "LinkTarget", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@LinkAlt", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "LinkAlt", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Priority", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Priority", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Setting", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Setting", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@CountView", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "CountView", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Views", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Views", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@CountClick", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "CountClick", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Clicks", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Clicks", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Passed", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "Passed", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "EndTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HL_Advertisement] SET [UserID] = @UserID, [ZoneID] = @ZoneID, [ADType] = @ADType, [ADName] = @ADName, [ImgUrl] = @ImgUrl, [ImgWidth] = @ImgWidth, [ImgHeight] = @ImgHeight, [FlashWmode] = @FlashWmode, [ADIntro] = @ADIntro, [LinkUrl] = @LinkUrl, [LinkTarget] = @LinkTarget, [LinkAlt] = @LinkAlt, [Priority] = @Priority, [Setting] = @Setting, [CountView] = @CountView, [Views] = @Views, [CountClick] = @CountClick, [Clicks] = @Clicks, [Passed] = @Passed, [EndTime] = @EndTime WHERE (([ADID] = @Original_ADID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ZoneID", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ZoneID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ADType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ADType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ADName", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "ADName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ImgUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "ImgUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ImgWidth", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ImgWidth", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ImgHeight", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ImgHeight", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@FlashWmode", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "FlashWmode", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ADIntro", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ADIntro", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@LinkUrl", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "LinkUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@LinkTarget", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "LinkTarget", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@LinkAlt", SqlDbType.NVarChar, 0, ParameterDirection.Input, 0, 0, "LinkAlt", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Priority", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Priority", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Setting", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Setting", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@CountView", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "CountView", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Views", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Views", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@CountClick", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "CountClick", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Clicks", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Clicks", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Passed", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "Passed", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "EndTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_ADID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[11];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT HL_Advertisement.*\r\nFROM HL_Advertisement";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "DELETE FROM HL_Advertisement\r\nWHERE (ADID = @ADID)";
			this._commandCollection[1].CommandType = CommandType.Text;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@ADID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "DELETE FROM [HL_Advertisement] WHERE  \r\n(ADID in(\r\nSelect *  From fn_Split(@adidArr,',')) )";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@adidArr", SqlDbType.VarChar, 1024, ParameterDirection.Input, 0, 0, "", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "SELECT ADID, ADIntro, ADName, ADType, Clicks, CountClick, CountView, EndTime, FlashWmode, ImgHeight, ImgUrl, ImgWidth, LinkAlt, LinkTarget, LinkUrl, Passed, Priority, Setting, UserID, Views, ZoneID FROM HL_Advertisement WHERE (ImgUrl = @imgurl)";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[3].Parameters.Add(new SqlParameter("@imgurl", SqlDbType.NVarChar, 255, ParameterDirection.Input, 0, 0, "ImgUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "Pr_GetAdByNameIntro";
			this._commandCollection[4].CommandType = CommandType.StoredProcedure;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@ADName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@ADIntro", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "pr_insertAdvertisement";
			this._commandCollection[5].CommandType = CommandType.StoredProcedure;
			this._commandCollection[5].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ZoneID", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ADType", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ADName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ImgUrl", SqlDbType.VarChar, 200, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ImgWidth", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ImgHeight", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@FlashWmode", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ADIntro", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@LinkUrl", SqlDbType.VarChar, 200, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@LinkTarget", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@LinkAlt", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Priority", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Setting", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@CountView", SqlDbType.Bit, 1, ParameterDirection.Input, 1, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Views", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@CountClick", SqlDbType.Bit, 1, ParameterDirection.Input, 1, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Clicks", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Passed", SqlDbType.Bit, 1, ParameterDirection.Input, 1, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime, 8, ParameterDirection.Input, 23, 3, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6] = new SqlCommand();
			this._commandCollection[6].Connection = this.Connection;
			this._commandCollection[6].CommandText = "SELECT ADID, ADIntro, ADName, ADType, Clicks, CountClick, CountView, EndTime, FlashWmode, ImgHeight, ImgUrl, ImgWidth, LinkAlt, LinkTarget, LinkUrl, Passed, Priority, Setting, UserID, Views, ZoneID FROM HL_Advertisement WHERE (ADID = @ADID)";
			this._commandCollection[6].CommandType = CommandType.Text;
			this._commandCollection[6].Parameters.Add(new SqlParameter("@ADID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[7] = new SqlCommand();
			this._commandCollection[7].Connection = this.Connection;
			this._commandCollection[7].CommandText = "UPDATE [HL_Advertisement] SET Passed =@boolpassed  WHERE \r\n(ADID in(\r\nSelect *  From fn_Split(@adidArr,',')) ) ";
			this._commandCollection[7].CommandType = CommandType.Text;
			this._commandCollection[7].Parameters.Add(new SqlParameter("@boolpassed", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "Passed", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[7].Parameters.Add(new SqlParameter("@adidArr", SqlDbType.VarChar, 1024, ParameterDirection.Input, 0, 0, "", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[8] = new SqlCommand();
			this._commandCollection[8].Connection = this.Connection;
			this._commandCollection[8].CommandText = "UPDATE HL_Advertisement\r\nSET ZoneID = @ZoneID, ADType = @ADType, ADName = @ADName, ImgUrl = @ImgUrl, \r\n      ImgWidth = @ImgWidth, ImgHeight = @ImgHeight, FlashWmode = @FlashWmode, \r\n      ADIntro = @ADIntro, LinkUrl = @LinkUrl, LinkTarget = @LinkTarget, \r\n      LinkAlt = @LinkAlt, Priority = @Priority, CountView = @CountView, Setting = @Setting, \r\n      Views = @Views, Clicks = @Clicks, CountClick = @CountClick, Passed = @Passed, \r\n      EndTime = @EndTime\r\nWHERE (ADID = @ADID)";
			this._commandCollection[8].CommandType = CommandType.Text;
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ZoneID", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, "ZoneID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ADType", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ADType", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ADName", SqlDbType.NVarChar, 100, ParameterDirection.Input, 0, 0, "ADName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ImgUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, 0, 0, "ImgUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ImgWidth", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ImgWidth", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ImgHeight", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ImgHeight", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@FlashWmode", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "FlashWmode", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ADIntro", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, "ADIntro", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@LinkUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, 0, 0, "LinkUrl", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@LinkTarget", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "LinkTarget", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@LinkAlt", SqlDbType.NVarChar, 255, ParameterDirection.Input, 0, 0, "LinkAlt", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@Priority", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "Priority", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@CountView", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "CountView", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@Setting", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, "Setting", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@Views", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "Views", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@Clicks", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "Clicks", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@CountClick", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "CountClick", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@Passed", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "Passed", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "EndTime", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@ADID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[9] = new SqlCommand();
			this._commandCollection[9].Connection = this.Connection;
			this._commandCollection[9].CommandText = "PR_ADCount";
			this._commandCollection[9].CommandType = CommandType.StoredProcedure;
			this._commandCollection[9].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[9].Parameters.Add(new SqlParameter("@ADID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[10] = new SqlCommand();
			this._commandCollection[10].Connection = this.Connection;
			this._commandCollection[10].CommandText = "UPDATE HL_Advertisement\r\nSET Views = Views + 1\r\nWHERE (ADID = @ADID)";
			this._commandCollection[10].CommandType = CommandType.Text;
			this._commandCollection[10].Parameters.Add(new SqlParameter("@ADID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ADID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable GetAllAD()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable FindFileByFileName(string imgurl)
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			if (imgurl == null)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = imgurl;
			}
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable GetAdByNameIntro(string ADName, string ADIntro)
		{
			this.Adapter.SelectCommand = this.CommandCollection[4];
			if (ADName == null)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = ADName;
			}
			if (ADIntro == null)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = ADIntro;
			}
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable GetReturnID(int? UserID, string ZoneID, int? ADType, string ADName, string ImgUrl, int? ImgWidth, int? ImgHeight, int? FlashWmode, string ADIntro, string LinkUrl, int? LinkTarget, string LinkAlt, int? Priority, string Setting, bool? CountView, int? Views, bool? CountClick, int? Clicks, bool? Passed, System.DateTime? EndTime)
		{
			this.Adapter.SelectCommand = this.CommandCollection[5];
			if (UserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = UserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (ZoneID == null)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = ZoneID;
			}
			if (ADType.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[3].Value = ADType.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (ADName == null)
			{
				this.Adapter.SelectCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[4].Value = ADName;
			}
			if (ImgUrl == null)
			{
				this.Adapter.SelectCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[5].Value = ImgUrl;
			}
			if (ImgWidth.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[6].Value = ImgWidth.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[6].Value = System.DBNull.Value;
			}
			if (ImgHeight.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[7].Value = ImgHeight.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[7].Value = System.DBNull.Value;
			}
			if (FlashWmode.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[8].Value = FlashWmode.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[8].Value = System.DBNull.Value;
			}
			if (ADIntro == null)
			{
				this.Adapter.SelectCommand.Parameters[9].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[9].Value = ADIntro;
			}
			if (LinkUrl == null)
			{
				this.Adapter.SelectCommand.Parameters[10].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[10].Value = LinkUrl;
			}
			if (LinkTarget.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[11].Value = LinkTarget.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[11].Value = System.DBNull.Value;
			}
			if (LinkAlt == null)
			{
				this.Adapter.SelectCommand.Parameters[12].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[12].Value = LinkAlt;
			}
			if (Priority.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[13].Value = Priority.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[13].Value = System.DBNull.Value;
			}
			if (Setting == null)
			{
				this.Adapter.SelectCommand.Parameters[14].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[14].Value = Setting;
			}
			if (CountView.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[15].Value = CountView.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[15].Value = System.DBNull.Value;
			}
			if (Views.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[16].Value = Views.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[16].Value = System.DBNull.Value;
			}
			if (CountClick.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[17].Value = CountClick.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[17].Value = System.DBNull.Value;
			}
			if (Clicks.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[18].Value = Clicks.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[18].Value = System.DBNull.Value;
			}
			if (Passed.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[19].Value = Passed.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[19].Value = System.DBNull.Value;
			}
			if (EndTime.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[20].Value = EndTime.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[20].Value = System.DBNull.Value;
			}
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable GetSingleAD(int ADID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[6];
			this.Adapter.SelectCommand.Parameters[0].Value = ADID;
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Fill, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateADCount1(S_Ad.HL_Advertisement1DataTable dataTable, int? ADID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[9];
			if (ADID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = ADID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (this.ClearBeforeFill)
			{
				dataTable.Clear();
			}
			return this.Adapter.Fill(dataTable);
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Ad.HL_Advertisement1DataTable UpdateADCount(int? ADID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[9];
			if (ADID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = ADID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			S_Ad.HL_Advertisement1DataTable hL_Advertisement1DataTable = new S_Ad.HL_Advertisement1DataTable();
			this.Adapter.Fill(hL_Advertisement1DataTable);
			return hL_Advertisement1DataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Ad.HL_Advertisement1DataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Ad dataSet)
		{
			return this.Adapter.Update(dataSet, "HL_Advertisement1");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Delete(int Original_ADID)
		{
			this.Adapter.DeleteCommand.Parameters[0].Value = Original_ADID;
			ConnectionState state = this.Adapter.DeleteCommand.Connection.State;
			if ((this.Adapter.DeleteCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.DeleteCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.DeleteCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.DeleteCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Insert(int? UserID, string ZoneID, int? ADType, string ADName, string ImgUrl, int? ImgWidth, int? ImgHeight, int? FlashWmode, string ADIntro, string LinkUrl, int? LinkTarget, string LinkAlt, int? Priority, string Setting, bool? CountView, int? Views, bool? CountClick, int? Clicks, bool? Passed, System.DateTime? EndTime)
		{
			if (UserID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (ZoneID == null)
			{
				this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[1].Value = ZoneID;
			}
			if (ADType.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[2].Value = ADType.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ADName == null)
			{
				this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[3].Value = ADName;
			}
			if (ImgUrl == null)
			{
				this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[4].Value = ImgUrl;
			}
			if (ImgWidth.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[5].Value = ImgWidth.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (ImgHeight.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[6].Value = ImgHeight.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
			}
			if (FlashWmode.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[7].Value = FlashWmode.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[7].Value = System.DBNull.Value;
			}
			if (ADIntro == null)
			{
				this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[8].Value = ADIntro;
			}
			if (LinkUrl == null)
			{
				this.Adapter.InsertCommand.Parameters[9].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[9].Value = LinkUrl;
			}
			if (LinkTarget.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[10].Value = LinkTarget.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[10].Value = System.DBNull.Value;
			}
			if (LinkAlt == null)
			{
				this.Adapter.InsertCommand.Parameters[11].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[11].Value = LinkAlt;
			}
			if (Priority.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[12].Value = Priority.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[12].Value = System.DBNull.Value;
			}
			if (Setting == null)
			{
				this.Adapter.InsertCommand.Parameters[13].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[13].Value = Setting;
			}
			if (CountView.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[14].Value = CountView.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[14].Value = System.DBNull.Value;
			}
			if (Views.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[15].Value = Views.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[15].Value = System.DBNull.Value;
			}
			if (CountClick.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[16].Value = CountClick.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[16].Value = System.DBNull.Value;
			}
			if (Clicks.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[17].Value = Clicks.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[17].Value = System.DBNull.Value;
			}
			if (Passed.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[18].Value = Passed.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[18].Value = System.DBNull.Value;
			}
			if (EndTime.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[19].Value = EndTime.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[19].Value = System.DBNull.Value;
			}
			ConnectionState state = this.Adapter.InsertCommand.Connection.State;
			if ((this.Adapter.InsertCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.InsertCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.InsertCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.InsertCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(int? UserID, string ZoneID, int? ADType, string ADName, string ImgUrl, int? ImgWidth, int? ImgHeight, int? FlashWmode, string ADIntro, string LinkUrl, int? LinkTarget, string LinkAlt, int? Priority, string Setting, bool? CountView, int? Views, bool? CountClick, int? Clicks, bool? Passed, System.DateTime? EndTime, int Original_ADID)
		{
			if (UserID.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (ZoneID == null)
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = ZoneID;
			}
			if (ADType.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = ADType.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ADName == null)
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = ADName;
			}
			if (ImgUrl == null)
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = ImgUrl;
			}
			if (ImgWidth.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = ImgWidth.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (ImgHeight.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = ImgHeight.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
			}
			if (FlashWmode.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[7].Value = FlashWmode.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[7].Value = System.DBNull.Value;
			}
			if (ADIntro == null)
			{
				this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[8].Value = ADIntro;
			}
			if (LinkUrl == null)
			{
				this.Adapter.UpdateCommand.Parameters[9].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[9].Value = LinkUrl;
			}
			if (LinkTarget.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[10].Value = LinkTarget.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[10].Value = System.DBNull.Value;
			}
			if (LinkAlt == null)
			{
				this.Adapter.UpdateCommand.Parameters[11].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[11].Value = LinkAlt;
			}
			if (Priority.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[12].Value = Priority.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[12].Value = System.DBNull.Value;
			}
			if (Setting == null)
			{
				this.Adapter.UpdateCommand.Parameters[13].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[13].Value = Setting;
			}
			if (CountView.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[14].Value = CountView.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[14].Value = System.DBNull.Value;
			}
			if (Views.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[15].Value = Views.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[15].Value = System.DBNull.Value;
			}
			if (CountClick.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[16].Value = CountClick.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[16].Value = System.DBNull.Value;
			}
			if (Clicks.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[17].Value = Clicks.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[17].Value = System.DBNull.Value;
			}
			if (Passed.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[18].Value = Passed.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[18].Value = System.DBNull.Value;
			}
			if (EndTime.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[19].Value = EndTime.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[19].Value = System.DBNull.Value;
			}
			this.Adapter.UpdateCommand.Parameters[20].Value = Original_ADID;
			ConnectionState state = this.Adapter.UpdateCommand.Connection.State;
			if ((this.Adapter.UpdateCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.UpdateCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.UpdateCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.UpdateCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteAD(int ADID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			sqlCommand.Parameters[0].Value = ADID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteAds(string adidArr)
		{
			SqlCommand sqlCommand = this.CommandCollection[2];
			if (adidArr == null)
			{
				throw new System.ArgumentNullException("adidArr");
			}
			sqlCommand.Parameters[0].Value = adidArr;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int PassedAd(bool? boolpassed, string adidArr)
		{
			SqlCommand sqlCommand = this.CommandCollection[7];
			if (boolpassed.HasValue)
			{
				sqlCommand.Parameters[0].Value = boolpassed.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (adidArr == null)
			{
				throw new System.ArgumentNullException("adidArr");
			}
			sqlCommand.Parameters[1].Value = adidArr;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateAD(string ZoneID, int? ADType, string ADName, string ImgUrl, int? ImgWidth, int? ImgHeight, int? FlashWmode, string ADIntro, string LinkUrl, int? LinkTarget, string LinkAlt, int? Priority, bool? CountView, string Setting, int? Views, int? Clicks, bool? CountClick, bool? Passed, System.DateTime? EndTime, int ADID)
		{
			SqlCommand sqlCommand = this.CommandCollection[8];
			if (ZoneID == null)
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = ZoneID;
			}
			if (ADType.HasValue)
			{
				sqlCommand.Parameters[1].Value = ADType.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (ADName == null)
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = ADName;
			}
			if (ImgUrl == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = ImgUrl;
			}
			if (ImgWidth.HasValue)
			{
				sqlCommand.Parameters[4].Value = ImgWidth.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			if (ImgHeight.HasValue)
			{
				sqlCommand.Parameters[5].Value = ImgHeight.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (FlashWmode.HasValue)
			{
				sqlCommand.Parameters[6].Value = FlashWmode.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			if (ADIntro == null)
			{
				sqlCommand.Parameters[7].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[7].Value = ADIntro;
			}
			if (LinkUrl == null)
			{
				sqlCommand.Parameters[8].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[8].Value = LinkUrl;
			}
			if (LinkTarget.HasValue)
			{
				sqlCommand.Parameters[9].Value = LinkTarget.Value;
			}
			else
			{
				sqlCommand.Parameters[9].Value = System.DBNull.Value;
			}
			if (LinkAlt == null)
			{
				sqlCommand.Parameters[10].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[10].Value = LinkAlt;
			}
			if (Priority.HasValue)
			{
				sqlCommand.Parameters[11].Value = Priority.Value;
			}
			else
			{
				sqlCommand.Parameters[11].Value = System.DBNull.Value;
			}
			if (CountView.HasValue)
			{
				sqlCommand.Parameters[12].Value = CountView.Value;
			}
			else
			{
				sqlCommand.Parameters[12].Value = System.DBNull.Value;
			}
			if (Setting == null)
			{
				sqlCommand.Parameters[13].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[13].Value = Setting;
			}
			if (Views.HasValue)
			{
				sqlCommand.Parameters[14].Value = Views.Value;
			}
			else
			{
				sqlCommand.Parameters[14].Value = System.DBNull.Value;
			}
			if (Clicks.HasValue)
			{
				sqlCommand.Parameters[15].Value = Clicks.Value;
			}
			else
			{
				sqlCommand.Parameters[15].Value = System.DBNull.Value;
			}
			if (CountClick.HasValue)
			{
				sqlCommand.Parameters[16].Value = CountClick.Value;
			}
			else
			{
				sqlCommand.Parameters[16].Value = System.DBNull.Value;
			}
			if (Passed.HasValue)
			{
				sqlCommand.Parameters[17].Value = Passed.Value;
			}
			else
			{
				sqlCommand.Parameters[17].Value = System.DBNull.Value;
			}
			if (EndTime.HasValue)
			{
				sqlCommand.Parameters[18].Value = EndTime.Value;
			}
			else
			{
				sqlCommand.Parameters[18].Value = System.DBNull.Value;
			}
			sqlCommand.Parameters[19].Value = ADID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateAdViews(int ADID)
		{
			SqlCommand sqlCommand = this.CommandCollection[10];
			sqlCommand.Parameters[0].Value = ADID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
